#ifndef  __OXC_H__
#define  __OXC_H__

#include "cc.h"
#include "common.h"
#include "user.h"
#include "timer.h"
#include "part.h"

#define OXC_CHANNEL_NUMBER 32

typedef struct _oxc_alarm_info{
    int swit;
    int port;
    int att;
    int miss;
    int fanw;
    int fanf;
    int fpga;
    int conf;
    int temp;
    int opml;
    int aps;
    int opmd;
    int oxc;
    int oxcp;
    int sys;
}oxc_alarm_info;

typedef struct _atten_s{
    float atten;
    int channel_num;
}atten_s;

typedef struct _oxc_device{    
    char busy;
    int exit;
    int uart_fd;
    int sample_flag;
    int print_flag;
    char* device_name;    
    timer* timer;

    oxc_alarm_info alarm_info;
    char model_type[64];
    char soft_version[32];
    char serial_number[32];

    int  save_begin;
    int in_count;
    int in_port[OXC_CHANNEL_NUMBER];
    int out_count;
    int out_port[OXC_CHANNEL_NUMBER];
    float atten_table[OXC_CHANNEL_NUMBER];
    int  save_end;
}oxc_device;

void* oxc_thread(void* param);

cJSON* oxc_parse(CMD_ID id,cJSON* param);
void oxc_alarm_register(device_alarm_list* p_list);
#endif // ! __OXC_H__
